An Interval-Based Inference of Variant Parametric Types

نویسندگان

  • Florin Craciun
  • Wei-Ngan Chin
  • Guanhua He
  • Shengchao Qin
چکیده

Variant parametric types represent the successful integration of subtype and parametric polymorphism to support a more flexible subtyping for Javalike languages. A key feature that helps strengthen this integration is the use-site variance. Depending on how the fields are used, each variance denotes a covariant, a contravariant, an invariant or a bivariant subtyping. By annotating variance properties on each type argument to a parametric class, programmers can choose various desirable variance properties for each use of the parametric class. Although Java library classes have been successfully refactored to use variant parametric types, these mechanisms are often criticized, due to the difficulty of choosing appropriate variance annotations. Several algorithms have been proposed for automatically refactoring legacy Java code to use generic libraries, but none can support the full flexibility of the use-site variance-based subtyping. This paper addresses this difficulty by proposing a novel interval-based approach to inferring both the variance annotations and the type arguments. Each variant parametric type is regarded as an interval type with two type bounds, a lower bound for writing and an upper bound for reading. We propose a constraint-based inference algorithm that works on a per method basis, as a summary-based analysis.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

A confidence-aware interval-based trust model

It is a common and useful task in a web of trust to evaluate the trust value between two nodes using intermediate nodes. This technique is widely used when the source node has no experience of direct interaction with the target node, or the direct trust is not reliable enough by itself. If trust is used to support decision-making, it is important to have not only an accurate estimate of trust, ...

متن کامل

Type-2 Fuzzy Hybrid Expert System For Diagnosis Of Degenerative Disc Diseases

One-third of the people with an age over twenty have some signs of degenerated discs. However, in most of the patients the mere presence of degenerative discs is not a problem leading to pain, neurological compression, or other symptoms. This paper presents an interval type-2 fuzzy hybrid rule-based system to diagnose the abnormal degenerated discs where pain variables are represented by interv...

متن کامل

Thermoeconomic Analysis and Parametric Study of Geothermal and Biomass Source ORC, Dual Fluid and Hybrid Power Plants

In this paper, we have continued doing a research project which had done previously. Three types of power plants include an Organic Rankine Cycle (ORC), a Dual-Fluid-Hybrid (DFH) and a single-fluid hybrid-fueled (HYB); were re-modeled. After model validation, thermodynamic studies and exergy analysis were extended for the defined cases using the first and second laws of thermodynamics. Then the...

متن کامل

A Practical, Typed Variant Object Model - Or, How to Stand On Your Head and Enjoy the View

Traditionally, typed objects have been encoded as records; the fields and methods of an object are stored in the fields of a record and projected when needed. While the dual approach of using variants instead of records has been explored, it is more challenging to type: the output type of a variant case match must depend on the input value; this is a form of dependent typing. In this paper, we ...

متن کامل

استنباط پیشگو ناپارامتری فازی بهینه برای طرح نمونه‌گیری جهت پذیرش یک مرحله‌ای

Acceptance sampling is one of the main parts of the statistical quality control. It is primarily used for the inspection of incoming or outgoing lots. Acceptance sampling procedures can be used in an acceptance control program to reach better quality with lower expenses, improvement of the control and the increase of efficiency. The aims of this paper, studying acceptance sampling based on non-...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2009